package com.xintonghua.api.interceptor;

import com.lzy.okgo.BuildConfig;
import com.lzy.okgo.interceptor.HttpLoggingInterceptor;


/**
 * 网络请求log日志拦截
 * 作者：wanxianyi
 * 时间：2018/1/18.
 * 包名：com.xintonghua.api.interceptor
 */

public class LogInterceptor extends HttpLoggingInterceptor {
    private static LogInterceptor log;

    public static LogInterceptor getInstance() {
        if (null == log) {
            log = new LogInterceptor("okGo_Log");
        }
        if (BuildConfig.DEBUG) {
            log.setPrintLevel(HttpLoggingInterceptor.Level.BODY);
            log.setColorLevel(java.util.logging.Level.INFO);
        }
        return log;
    }

    public LogInterceptor(String tag) {
        super(tag);
    }
}
